﻿//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////  LIBRERIA: SIMA.CORE                                                                                             ////
////  DESARROLLADO POR JUAN CARLOS VEGA NEIRA                                                                         ////
////  UNIVERSIDAD RICARDO PALMA                                                                                       ////
////  CURSO DE TALLER DE GERENTCIA DE PROYECTOS                                                                       ////
////  SEMESTRE 2010 - II                                                                                              ////
////  SEPTIEMBRE, 2010                                                                                                ////
////  TODOS LOS DERECHOS RESERVADOS                                                                                   ////
////  VERSIÓN v1.0                                                                                                    ////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

using System;

namespace SIMA.Core.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ForeignKey : Attribute
    {

        #region Fields

        private string foreignKeyName;
        private string tableTarget;
        private Type foreignClassType;

        #endregion

        #region Properties

        public string TableTarget
        {
            get { return tableTarget; }
            set { tableTarget = value; }
        }

        public string ForeignKeyName
        {
            get { return foreignKeyName; }
            set { foreignKeyName = value; }
        }

        public Type ForeignClassType
        {
            get { return foreignClassType; }
            set { foreignClassType = value; }
        }

        #endregion

        #region Constructor

        public ForeignKey(string TargetTable)
        {
            tableTarget = TargetTable;
        }

        public ForeignKey(string TargetTable, string foreignKeyName)
        {
            tableTarget = TargetTable;
            this.foreignKeyName = foreignKeyName;
        }

        public ForeignKey(string TargetTable, string foreignKeyName, Type foreignClass)
        {
            tableTarget = TargetTable;
            this.foreignKeyName = foreignKeyName;
            this.ForeignClassType = foreignClassType;
        }

        #endregion

    }
}
